package com.gitee.wsl.unit.angle.ext

import androidx.compose.ui.geometry.Offset
import com.gitee.wsl.unit.angle.AngleUnit

/**
 * Polar to cartesian coordinate transformation.
 */
fun AngleUnit.calcXY(radius: Float): Offset = Offset((radius * cosF()), (radius * sinF()))

fun AngleUnit.calcXY(center: Offset, radius: Float): Offset {
    return Offset(calcX(center.x, radius).toFloat(),calcY(center.y,radius).toFloat())
}